# core/codecs/mqa_detector.py
class MQAAnalyzer:
    MQA_MAGIC = b'MQA\x00\x01\x40'
    
    def detect_mqa_layers(self, file_path):
        with open(file_path, 'rb') as f:
            f.seek(-32, os.SEEK_END)
            footer = f.read(32)
            
        if footer[16:22] == self.MQA_MAGIC:
            return {
                'is_origami': bool(footer[23] & 0x80),
                'folding_level': footer[24],
                'sample_rate': struct.unpack('I', footer[25:29])[0]
            }
        return None